"""
Python程序设计语言第5周：课堂练习（条件和循环）
第2题：输入年份和月份，计算并输出该月有多少天
"""

year = int(input('年份：'))
month = int(input('月份：'))
days = 0

# 判断是哪个月份，决定天数
if month == 1 or month == 3 or month == 5 or month == 7 or month == 8 or month == 10 or month == 12:
    days = 31
elif month == 4 or month == 6 or month == 9 or month == 11:
    days = 30
elif month == 2:
    days = 28
    # 判断是否是闰年
    if year % 400 == 0 or year % 4 == 0 and year % 100 != 0:
        days = 29
else:
    print("错误的月份！")


if days > 0:
    print(f"{year}年{month}月有{days}天")